#define _CRT_SECURE_NO_WARNINGS 1
#include "list.h"
#include <stdlib.h>
#include <stdio.h>
#define NAME_SIZE 32
struct score_node
{
	int id;
	char name[NAME_SIZE];
	int math;
	int chinese;
	int english;

};

void print_st(const void* record)
{
	const struct score_node* s = record;
	printf("%d %s %d %d %d", s->id, s->name, s->math, s->chinese, s->english);
}

int main()
{
	int i;
	DLINKLIST * handler;
	struct score_node tmp;
	handler = llist_create(sizeof(struct score_node));
	for (i=0;i<6;i++)
	{
		tmp.id = i;
		snprintf(tmp.name, NAME_SIZE, "student%d", i);
		tmp.math = rand() % 100;
		tmp.english = rand() % 100;
		tmp.chinese = rand() % 100;
		llist_insert(handler, &tmp,FORWARD);
	}
	llist_travel(handler,print_st);
	llist_destroy(handler);
	return 0;
}